home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-05-25 | 5.4 KB | 167 lines | [TEXT/MPS ] |
- ;
- ; File: MacLocales.a
- ;
- ; Contains: Types & prototypes for locale functions
- ;
- ; Version: Technology: Veronica
- ; Release: Veronica Seed, Use with 3.2 Universal Interfaces
- ;
- ; Copyright: © 1998-1999 by Apple Computer, Inc., all rights reserved.
- ;
- ; Bugs?: For bug reports, consult the following page on
- ; the World Wide Web:
- ;
- ; http://developer.apple.com/bugreporter/
- ;
- ;
- IF &TYPE('__MACLOCALES__') = 'UNDEFINED' THEN
- __MACLOCALES__ SET 1
-
- IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
- include 'MacTypes.a'
- ENDIF
-
-
- ; -------------------------------------------------------------------------------------------------
- ; ERROR/STATUS CODES
- ; -------------------------------------------------------------------------------------------------
-
-
-
-
- kLocalesBufferTooSmallErr EQU -30001
- kLocalesDefaultDisplayStatus EQU -30029 ; Requested display locale unavailable, used default
-
- ; -------------------------------------------------------------------------------------------------
- ; TYPES & CONSTANTS
- ; -------------------------------------------------------------------------------------------------
-
-
-
-
-
- ; typedef UInt32 LocalePartMask
-
-
- ; bit set requests the following:
- kLocaleLanguageMask EQU $00000001 ; ISO 639-1 or -2 language code (2 or 3 letters)
- kLocaleLanguageVariantMask EQU $00000002 ; custom string for language variant
- kLocaleScriptMask EQU $00000004 ; ISO 15924 script code (2 letters)
- kLocaleScriptVariantMask EQU $00000008 ; custom string for script variant
- kLocaleRegionMask EQU $00000010 ; ISO 3166 country/region code (2 letters)
- kLocaleRegionVariantMask EQU $00000020 ; custom string for region variant
- kLocaleAllPartsMask EQU $0000003F ; all of the above
- ; typedef FourCharCode LocaleOperationClass
-
-
- kUnicodeCollationClass EQU 'ucol'
- kUnicodeTextBreakClass EQU 'ubrk'
- ; typedef FourCharCode LocaleOperationVariant
-
- LocaleAndVariant RECORD 0
- locale ds.l 1 ; offset: $0 (0)
- opVariant ds.l 1 ; offset: $4 (4)
- sizeof EQU * ; size: $8 (8)
- ENDR
- ; typedef UInt32 LocaleNameMask
-
-
- ; bit set requests the following:
- kLocaleNameMask EQU $00000001 ; name of locale
- kLocaleOperationVariantNameMask EQU $00000002 ; name of LocaleOperationVariant
- kLocaleAndVariantNameMask EQU $00000003 ; all of the above
-
- ; -------------------------------------------------------------------------------------------------
- ; FUNCTION PROTOTYPES
- ; -------------------------------------------------------------------------------------------------
-
-
-
- ; Convert to or from LocaleRefs
-
- ;
- ; extern OSStatus LocaleRefFromLangOrRegionCode(LangCode lang, RegionCode region, LocaleRef *locale)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleRefFromLangOrRegionCode
- ENDIF
-
- ;
- ; extern OSStatus LocaleRefFromLocaleString(const char *localeString, LocaleRef *locale)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleRefFromLocaleString
- ENDIF
-
- ;
- ; extern OSStatus LocaleRefGetPartString(LocaleRef locale, LocalePartMask partMask, ByteCount maxStringLen, char *partString)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleRefGetPartString
- ENDIF
-
- ; Enumerate locales for a LocaleOperationClass
-
- ;
- ; extern OSStatus LocaleOperationCountLocales(LocaleOperationClass opClass, ItemCount *localeCount)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleOperationCountLocales
- ENDIF
-
- ;
- ; extern OSStatus LocaleOperationGetLocales(LocaleOperationClass opClass, ItemCount maxLocaleCount, ItemCount *actualLocaleCount, LocaleAndVariant localeVariantList[2147483647])
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleOperationGetLocales
- ENDIF
-
- ; Get names for a locale
-
- ;
- ; extern OSStatus LocaleGetName(LocaleRef locale, LocaleOperationVariant opVariant, LocaleNameMask nameMask, LocaleRef displayLocale, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleGetName
- ENDIF
-
- ;
- ; extern OSStatus LocaleCountNames(LocaleRef locale, LocaleOperationVariant opVariant, LocaleNameMask nameMask, ItemCount *nameCount)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleCountNames
- ENDIF
-
- ;
- ; extern OSStatus LocaleGetIndName(LocaleRef locale, LocaleOperationVariant opVariant, LocaleNameMask nameMask, ItemCount nameIndex, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName, LocaleRef *displayLocale)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleGetIndName
- ENDIF
-
- ; Get names for a LocaleOperationClass
-
- ;
- ; extern OSStatus LocaleOperationGetName(LocaleOperationClass opClass, LocaleRef displayLocale, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleOperationGetName
- ENDIF
-
- ;
- ; extern OSStatus LocaleOperationCountNames(LocaleOperationClass opClass, ItemCount *nameCount)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleOperationCountNames
- ENDIF
-
- ;
- ; extern OSStatus LocaleOperationGetIndName(LocaleOperationClass opClass, ItemCount nameIndex, UniCharCount maxNameLen, UniCharCount *actualNameLen, UniChar *displayName, LocaleRef *displayLocale)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION LocaleOperationGetIndName
- ENDIF
-
- ENDIF ; __MACLOCALES__
-
-